package cn.cdeden.knowledge.domain;

import cn.cdeden.knowledge.domain.dto.SysCalendarDto;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
//import io.swagger.annotations.ApiModelProperty;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMappers;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
* @author Yu.
* @date 2023-02-02
*/
@Data
@AutoMappers({@AutoMapper(target = SysCalendarDto.class)})
@TableName("sys_calendar")
public class SysCalendar implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type= IdType.AUTO)
    private Long id;

//    @ApiModelProperty(value = "标签")
    private String label;

//    @ApiModelProperty(value = "内容")
    private String content;

//    @ApiModelProperty(value = "类型")
    private String calendarType;

//    @ApiModelProperty(value = "颜色代码")
    private String calendarColor;

//    @ApiModelProperty(value = "优先级")
    private String calendarPriority;

//    @ApiModelProperty(value = "开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startDate;

//    @ApiModelProperty(value = "结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endDate;

//    @ApiModelProperty(value = "拥有者编号")
    @TableField(fill= FieldFill.INSERT)
    private String createId;

//    @ApiModelProperty(value = "创建者")
    @TableField(fill= FieldFill.INSERT)
    private String createBy;

//    @ApiModelProperty(value = "创建日期")
    @TableField(fill= FieldFill.INSERT)
    private Date createTime;

//    @ApiModelProperty(value = "更新编号")
    @TableField(fill= FieldFill.INSERT_UPDATE)
    private String updateId;

//    @ApiModelProperty(value = "更新者")
    @TableField(fill= FieldFill.INSERT_UPDATE)
    private String updateBy;

//    @ApiModelProperty(value = "更新时间")
    @TableField(fill= FieldFill.INSERT_UPDATE)
    private Date updateTime;

//    @ApiModelProperty(value = "状态")
    private String state;

//    @ApiModelProperty(value = "日历ID")
    private Long scheduleId;

//    @ApiModelProperty(value = "反馈标识")
    private String feedBack;

//    @ApiModelProperty(value = "资源ID")
    private String resourceId;

//    @ApiModelProperty("地点")
    private String place;

//    @ApiModelProperty("我的任务标识")
    private String mission;

//    @ApiModelProperty("任务ID")
    private Long missionId;

//    @ApiModelProperty("提醒时间")
    private Integer remindTime;

//    @ApiModelProperty("日程类型")
    private String type;

//    @ApiModelProperty("日程工时")
    private Double workHours;

    public void copyFrom(SysCalendar source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
